#include<iostream>
#include<vector>
using namespace std;

class MyClass {
public:
    MyClass(int a, int b) : a_(a), b_(b) {
        std::cout << "MyClass constructed with (" << a_ << ", " << b_ << ")"<< std::endl;
    }

private:
    int a_;
    int b_;
};

int main() {
    std::vector<MyClass> myVector;

    // 使用 emplace_back 在 myVector 的末尾就地构造一个 MyClass 对象
    myVector.emplace_back(1, 2);

    MyClass tmp(2, 3);
    myVector.push_back(tmp);    // 复制了一次对象

    return 0;
}